package user;

import ioperation.*;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-23
 * Time: 20:13
 */
//普通用户
public class NormalUser extends User{
    public NormalUser(String name) {
        //帮助父类完成初始化
        super(name);

        ////在iOperations数组中按照下标存放对应操作
        iOperations = new IOperation[] {
                new ExitOperation(),//退出系统
                new FindOperation(),//查找图书
                new BorrowOperation(),//借阅图书
                new ReturnOperation()//归还图书
        };
    }
    @Override
    //打印菜单（重写方法）
    public int menu() {
        System.out.println("========图书管理系统========");
        System.out.println("====1.查找图书 2.借阅图书====");
        System.out.println("====3.归还图书 0.退出系统====");
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入您的操作：");
        int choice = scanner.nextInt();
        return choice;
    }
}
